package com.zsy.rocketdemo.produce;

import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.remoting.exception.RemotingException;
import org.springframework.stereotype.Component;

@Component
public class ZsyDelayProducer extends BaseProducer {

    public ZsyDelayProducer() {
        tag = "zsyDelay";
    }

    @Override
    public void sendMessage(Message message) throws InterruptedException, RemotingException, MQClientException, MQBrokerException {
        message.setDelayTimeLevel(3);
        super.sendMessage(message);
        System.out.println(message);
    }
}
